{include file="common/header" /}

<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <div class="layuimini-container" style="margin-top: 10px;">
            <div class="layuimini-main">
                <div>
                    <div class="layui-btn-group">
                        <a href="javascript:location=location;" class="layui-btn layui-btn-sm">更新</a>
                        <?php if(input('param.fname')){?>
                        <a href="{:url('template/index')}" class="layui-btn layui-btn-sm">返回上一层</a>
                        <?php }?>
                        <?php if(input('param.fname')){?>
                        <a href="{:url('template/edit_all',array('fname'=>$fname))}" class="layui-btn layui-btn-sm">替换所有模板</a>
                        <?php }else{?>
                        <!--<a href="{:url('template/edit_all')}" class="layui-btn layui-btn-sm">替换所有模板</a>-->
                        <?php }?>
                    </div>
                </div>
            </div>
        </div>

        <table class="layui-table">
          <colgroup>
            <col >
            <col >
            <col>
          </colgroup>
          <thead>
            <tr>
                <th>文件名称</th>
                <th>文件大小</th>
                <th>修改日期</th>
                <th>操作</th>
            </tr> 
          </thead>
          <tbody>
            {php}$i=1;{/php}
            {volist name="files" id="vo"}
            <tr id="{$i}">
                <td>
                    {eq name="$vo['type']" value="dir"}
                        <a href="{:url('admin/template/index',array('fname'=>$vo['name']))}">
                            {$vo.name}[文件夹]
                        </a>
                    {else/}
                        {$vo.name}
                    {/eq}
                </td>
                <td>{$vo.filesize}</td>
                <td>{$vo.uptime}</td>
               
                <td>
                    {eq name="$vo['type']" value="file"}
                    <a href="{:url('admin/template/edit',array('file'=>$vo['name'],'fname'=>input('param.fname')))}"  class="layui-btn layui-btn-xs">修改</a>
                    {/eq}
                    <!-- file 文件名   fname 文件名  dtype 是dir 还是 file-->
                    <a data-url="{:url('template/delete',array('file'=>$vo.name,'fname'=>$vo.name,'dtype'=>$vo['type']))}" class="del  layui-btn layui-btn-xs layui-btn-danger">删除</a>
            
                </td>
            </tr>
            {php}$i++;{/php}
            {/volist}
          </tbody>
        </table>

    </div>
</div>

<script>
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
            layuimini = layui.layuimini;
            

    });
</script>

</body>
</html>